import { Button, Tooltip } from 'antd';
import { Fragment } from 'react';
import { PlusCircleOutlined, EditOutlined, EyeOutlined } from '@ant-design/icons';
// import { stateOfRendering } from '../common';
import { history } from 'umi';
import { fieldFlowExport, getKeyRouter, getTenantID } from '@/utils';

// Table表格的配置
const getTableColumns = () => {
  return [
    {
      title: '任务编号',
      dataIndex: 'id',
      key: 'id',
      visible: true,
      width: 50,
      unDrag: false,
      //   fixed: 'left',
      //   sorter: (a: any, b: any) => (a?.id > b?.id ? 1 : -1),
      // render: (text: string | null) => ColumnsRenderFun({ text, wordNum: 100 }),
    },
    {
      title: '任务名称',
      dataIndex: 'applyInfo',
      key: 'applyInfo',
      //   fixed: 'left',
      visible: true,
      width: 120,
      unDrag: false,
      //   sorter: (a: any, b: any) => (a?.fullName > b?.fullName ? 1 : -1),
      render: (text: string | null, record: Record<string, any>) => {
        return <a style={{ color: '100%', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: 'block' }}>{text}</a>;
      },
    },
    {
      title: '办理人岗位',
      dataIndex: 'applyState',
      key: 'applyState',
      visible: true,
      width: 120,
      unDrag: false,
      //   sorter: (a: any, b: any) => (a?.materialType > b?.materialType ? 1 : -1),
      // render: (text: string | null) => DictionaryRenderFun({ text }),
    },
    {
      title: '办理人',
      dataIndex: 'workflowID',
      key: 'workflowID',
      visible: true,
      width: 120,
      unDrag: false,
      //   sorter: (a: any, b: any) => (a?.specInfo > b?.specInfo ? 1 : -1),
      // render: (text: string | null) => ColumnsRenderFun({ text }),
    },
    {
      title: '是否会签',
      dataIndex: 'applyStartTime',
      key: 'applyStartTime',
      visible: true,
      width: 120,
      unDrag: false,
      //   sorter: (a: any, b: any) => (a?.modelNum > b?.modelNum ? 1 : -1),
      // render: (text: string | null) => ColumnsRenderFun({ text }),
    },
    // {
    //   title: (
    //     <div style={{ width: '100%', textAlign: 'center' }}>
    //       <Button type="link" size="small" icon={<PlusCircleOutlined />} className="manageBtntTxtStyle" >
    //         添加
    //       </Button>
    //     </div>
    //   ),
    //   dataIndex: 'operation',
    //   key: 'operation',
    //   width: 80,
    //   visible: true,
    //   unDrag: true,
    //   fixed: 'right',
    //   render: (_: string, record: Record<string, any>) => {
    //     return (
    //       <Fragment>
    //         {
    //           <Button onClick={() => {
    //             history.push({
    //                 pathname: `/assettransfer/add/:${getKeyRouter()}${getKeyRouter()}`,
    //                 state: {
    //                   pageType: 'view',
    //                 },
    //               });
    //           }} type={'link'} size={'small'} icon={<EyeOutlined />}>
    //             查看
    //           </Button>
    //         }
    //         {
    //           <Button type={'link'} size={'small'} icon={<EditOutlined />} onClick={() => {
    //           }}>
    //             编辑
    //           </Button>
    //         }
    //       </Fragment>
    //     );
    //   },
    // },
  ];
};

export { getTableColumns };
